<%@ page import="domain.News" %>
<%@ page import="java.util.List" %>
<%@ page import="domain.SysUser" %>
<%@ page import="service.AdminService" %>
<%--
  Created by IntelliJ IDEA.
  User: HUAWEI
  Date: 2024/1/6
  Time: 14:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>新闻修改</title>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>

</head>
<body>
<%@include file="header.jsp" %>

<div class="row" style="padding-top: 20px">
    <div class="col-1"></div>
    <div class="col-4">
        <a href="newsManagement" type="button" class="btn btn-primary">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-90deg-left" viewBox="0 0 16 16">
                <path fill-rule="evenodd" d="M1.146 4.854a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 4H12.5A2.5 2.5 0 0 1 15 6.5v8a.5.5 0 0 1-1 0v-8A1.5 1.5 0 0 0 12.5 5H2.707l3.147 3.146a.5.5 0 1 1-.708.708l-4-4z"/>
            </svg>
            返回
        </a>
    </div>
    <div class="col-2"><h4>新闻修改页面</h4></div>
    <div class="col-5"></div>
</div>

<div class="row" style="padding-top: 20px">
    <div class="col"></div>
    <div class="col-6">
        <form method="post" action="modifyData" enctype="multipart/form-data">
            <div class="form-group">
                <p>
                    <label for="Title" style="float: left">选择新闻类型</label><label
                        style="color:red;float: left">*</label>
                    <select class="form-control" name="newsTypeId">
                        <c:forEach items="${newsTypeList1}" var="news">
<%--                            ${news.newsTypeId}--%>
<%--                            <option value="${news.newsTypeId}" ${news.newsTypeId == newsData.newsTypeId ? "selected" : ""}>${news.newsTypeName}</option>--%>
                            <option value="${news.newsTypeId}">${news.newsTypeName}</option>
                        </c:forEach>

                    </select>
                </p>
                <p>
                    <label for="Title" style="float: left">新闻标题</label><label
                        style="color:red;float: left">*</label>
                    <input type="text" class="form-control" id="Title" name="title" value="${newsData.newsTitle}">
                </p>
                <p>
                    <label for="exampleFormControlTextarea1">新闻内容</label><label
                        style="color:red;float: left">*</label>
                    <textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="content"></textarea>
                    <script>
                        document.getElementById("exampleFormControlTextarea1").value = "${newsData.newsContent}"
                    </script>
                </p>
                <p>

                    <label for="Title" style="float: left">选择发布日期</label><label
                        style="color:red;float: left">*</label><br/><br/>
                    <input type="datetime-local" id="datetime" name="datetime" value="${newsData.newsDate}"/>
                </p>
<%--                <p>
                    <label for="Title" style="float: left">上传图片</label><label
                        style="color:red;float: left">*</label>
                    <input type="file" class="form-control-file" id="exampleFormControlFile1" name="file">
                    <script>
                        document.getElementById("exampleFormControlFile1").value="${newsData.newsImage}"
                    </script>
                </p>--%>
                <p>
                    <input type="submit" class="btn btn-danger btn-lg btn-block" value="修  改">
                </p>
            </div>
        </form>
    </div>
    <div class="col"></div>
</div>
</body>
</html>
